<script setup>
import { ref, onMounted } from 'vue';
import { useRoute } from 'vue-router';

const route = useRoute();

// 从路由参数中获取考试信息
const examType = ref(route.query.examType || '');
const examYear = ref(route.query.examYear || '');
const isPastExam = ref(route.query.isPastExam === 'true');

onMounted(() => {
  if (isPastExam.value) {
    // 加载历年套卷题目
    loadPastExamQuestions();
  } else {
    // 加载模拟考试题目
    loadMockExamQuestions();
  }
});

const loadPastExamQuestions = async () => {
  try {
    const response = await axios.get('/api/exam/past-exams', {
      params: {
        examType: examType.value,
        year: examYear.value
      }
    });
    // 处理题目数据...
  } catch (error) {
    console.error('加载历年套卷题目失败:', error);
  }
};
</script>